package rmmk.algorithms.preprocessing.filters;

public class RemoveMostCommonFilter{// implements IWordFilter {

		static public  String[] common = new String[] {
		"in", "the", "from", "to", "by", "and", "at", "were", "for","of",
		"a" , "be" , "will","as","is", "it", "on", "an","with","was", "mln",
		"billion", "pct", "billi", "end", "how", "now"
		};
	
	public String processWord(String word) {
		return !equalsAny(word) ? word : null;
	}
	
	private boolean equalsAny(String word)
	{
		for(int i = 0; i < common().length; ++i)
			if(common()[i].equalsIgnoreCase(word))
				return true;
		return false;
	}

	private static String[] common(){		
		return rmmk.algorithms.features.global.GlobalWordCounts.getGlobalWords();
	}
}
